package com.example.qxfw.qxsjtj.service.impl;

import com.example.qxfw.qxsjtj.entity.vo.MeteorologicalDataVo;
import com.example.qxfw.qxsjtj.mapper.MeteorologicalDataStatisticsMapper;
import com.example.qxfw.qxsjtj.service.MeteorologicalDataStatisticsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 气象数据查询统计
 */
@Service
public class MeteorologicalDataStatisticsServiceImpl implements MeteorologicalDataStatisticsService {

    @Resource
    private MeteorologicalDataStatisticsMapper meteorologicalDataStatisticsMapper;

    /**
     * 气象数据查询统计
     *
     * @return
     */
    public List<Map<String, Object>> getMaxWindValue(MeteorologicalDataVo meteorologicalDataVo) {
        // 统计降水
        if (meteorologicalDataVo.getType() == 1) {
            return meteorologicalDataStatisticsMapper.getRainData(meteorologicalDataVo);
        }
        return meteorologicalDataStatisticsMapper.getMaxWindValue(meteorologicalDataVo);
    }


}